<div class="hte-layout hte-layout-fill">
	<div class="hte-panel clearfix hte-fixed" style="padding:10px;">
		<div class="example-section">
			<h3>打开APP</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-1" class="code-editor" style="width: 100%;height: 100px;">
	
	var app = HteOS.app.AppManager.getByKey("store");					
	HteOS.TaskManager.start(app);
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-1">
						<span class="glyphicon glyphicon-play" /> 运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>打开APP</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-1" class="code-editor" style="width: 100%;height: 100px;">
	
	var app = HteOS.app.AppManager.getByKey("myhteos");					
	HteOS.TaskManager.start(app);
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-1">
						<span class="glyphicon glyphicon-play" /> 运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>启动自定义窗口任务</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-1" class="code-editor" style="width: 100%;height: 100px;">
						
	HteOS.TaskManager.start({
			id : 'exampleTask1',
			mode : 'window',
			path : 'http://www.hteos.com',
			name : 'HteOS官方网站',
			icon : HteOS.basePath + 'images/logo.png'
		});
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-1">
						<span class="glyphicon glyphicon-play" /> 运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>启动自定义窗口任务自定义参数</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-2" class="code-editor" style="width: 100%;height: 100px;">
	HteOS.TaskManager.start({
			id : 'exampleTask2',
			mode : 'window',
			path : 'http://www.hteos.com',
			name : 'HteOS官方网站',
			icon : HteOS.basePath + 'images/logo.png',
			width:300,
			height : 550,
			right : 100,
			resizable : false,
			maximizable : false
		});
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-2">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
		<div class="example-section">
			<h3>启动自定义侧边栏任务</h3>
			<div>
				<div class="code-panel">
					<textarea id="message-example-3" class="code-editor" style="width: 100%;height: 100px;">
HteOS.TaskManager.start({
			id : 'exampleTask3',
			mode : 'dock',
			path : 'http://www.hteos.com',
			name : 'HteOS官方网站',
			loadType : 'iframe'
		});
					</textarea>
				</div>
				<div>
					<button class="btn btn-primary hte-medium-btn" hte-run="message-example-3">
						<span class="glyphicon glyphicon-play" />运行
					</button>
				</div>
			</div>
		</div>
	</div>
	<script>
		//添加一次性事件
		exampleApp.once('load',function(){
			$(".example-section").each(function(){
				var textarea = $(this).find(".code-editor");
				var editor = CodeMirror.fromTextArea(textarea.get(0), {
					lineNumbers: true,
					mode: {
						name: "javascript",
						globalVars: true
					},
					lineWrapping: true
				});
				/*$("[hte-run="+ this.id +"]").click(function(){
					parent.eval(editor.getValue());
				});*/
				 $(this).find("[hte-run]").click(function(){
				 	parent.eval(editor.getValue());
				 });
			});
		});
		//添加一次性事件
		exampleApp.once('unload',function(){
		});
	</script>
</div>